Package com.netscape.cmscore.util
Class UtilMessage
java.lang.Object
com.netscape.cmscore.util.UtilMessage
This object is used to easily create I18N messages for utility
classes and standalone programs.
- Version:
- $Revision$, $Date$
- Author:
- mikep
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a message from a base exception.UtilMessage
(String msgFormat) Constructs a message eventUtilMessage
(String msgFormat, Exception exception) Constructs a message from an exception.UtilMessage
(String msgFormat, Object[] params) Constructs a message event with a list of parameters that will be substituted into the message format.UtilMessage
(String msgFormat, String param) Constructs a message with a parameter. -
Method Summary
-
Field Details
-
mParams
-
-
Constructor Details
-
UtilMessage
Constructs a message event- Parameters:
msgFormat
- the message string
-
UtilMessage
Constructs a message with a parameter. For example,new UtilMessage("failed to load {0}", fileName);
- Parameters:
msgFormat
- details in message string formatparam
- message string parameter
-
UtilMessage
Constructs a message from an exception. It can be used to carry a system exception that may contain information about the context. For example,try { ... } catch (IOExeption e) { out.println(new UtilMessage("Encountered System Error {0}", e); }
- Parameters:
msgFormat
- exception details in message string formatexception
- system exception
-
UtilMessage
Constructs a message from a base exception. This will use the msgFormat from the exception itself.try { ... } catch (Exception e) { System.out.println(new UtilMessage(e)); }
- Parameters:
e
- CMS exception
-
UtilMessage
Constructs a message event with a list of parameters that will be substituted into the message format.- Parameters:
msgFormat
- message string formatparams
- list of message format parameters
-
-
Method Details
-
getMessage
Returns the current message format string.- Returns:
- details message
-
getParameters
Returns a list of parameters.- Returns:
- list of message format parameters
-
toString
Returns localized message string. This method should only be called if a localized string is necessary. -
toString
Returns the string based on the given locale.- Parameters:
locale
- locale- Returns:
- details message
-
getBundleName
Gets the resource bundle name for this class instance. This should be overridden by subclasses who have their own resource bundles.
-